package operation.impl;

import book.Book;
import book.BookList;
import operation.IOperation;

/**
 *新增书籍
 */
public class AddOperation implements IOperation {

    @Override
    public void work(BookList bookList) {
        System.out.println("当前进行的是新增书籍操作~");
        System.out.print("请输入书籍名称：");
        String bookName= scanner.next();
        System.out.print("请输入书籍作者：");
        String author= scanner.next();
        System.out.print("请输入书籍价格：");
        double prize= scanner.nextDouble();
        System.out.print("请输入书籍类型：");
        String type= scanner.next();

        Book book=new Book(bookName,author,prize,type);
        bookList.add(book);
        System.out.println("新增书籍成功！");
    }
}
